'use strict';

const Subscription = require('egg').Subscription;

class CountCommissionSubscription extends Subscription {
  static get schedule() {
    return {
      immediate: true,
      cron: '0 0 3 * * *',
      type: 'worker',
    };
  }
  async subscribe() {
    const ctx = this.app.createAnonymousContext();
    await ctx.service.commission.index();
  }
}

module.exports = CountCommissionSubscription;
